public static int findCheapestPrice(int n, int[][] flights, int src, int dst, int k) {
        ArrayList<Integer> ways=new ArrayList<>();
        // 先找出所有的路径的价格
        // 1、直达路径
        for(int i=0;i<flights.length;i++){
            if(flights[i][0]==src && flights[i][1]==dst){
                ways.add(flights[i][2]);
            }
        }
        // src dst price k
        ArrayList<int[]> list=new ArrayList<>();
        for(int i=0;i<flights.length;i++){
            list.add(new int[]{flights[i][0],flights[i][1],flights[i][2],0});
        }
//        // 2.不是直达的
//        for(int i=0;i<flights.length;i++){
//            for(int j=0;j<flights.length;j++){
//                if(flights[j][0]==flights[i][1]) {
//                    list.add(new int[]{flights[i][0], flights[j][1],
//                            (flights[i][2] + flights[j][2]), 1});
//                }
//            }
//        }

        for(int j=0;j<flights.length;j++) {
            for (int s = 0; s < list.size(); s++) {
                if (flights[j][0] == list.get(s)[1]) {
                    int temp = list.get(s)[3] + 1;
                    int price = list.get(s)[2] + flights[j][2];
                    list.add(new int[]{list.get(s)[0], flights[j][1], price, temp});

                }
            }
        }
        int len=list.size();
        for(int j=0;j<len;j++) {
            for (int s = 0; s < len; s++) {
                if (list.get(j)[0] == list.get(s)[1]) {
                    int temp = list.get(s)[3] +list.get(j)[2]+ 1;
                    int price = list.get(s)[2] + list.get(j)[2];
                    list.add(new int[]{list.get(s)[0], list.get(j)[1], price, temp});

                }
            }
        }
        for(int i=0;i<list.size();i++){
            System.out.println(list.get(i)[0]+" "+list.get(i)[1]+" "+ list.get(i)[2] +" "+list.get(i)[3]);
            if(list.get(i)[0]==src && list.get(i)[1]==dst && list.get(i)[3]<=k){
                ways.add(list.get(i)[2]);
            }
        }
        if(ways.size()==0) return -1;
        int minPrice=ways.get(0);
        for(int i=0;i<ways.size();i++){
            //System.out.println(ways.get(i));
            if(ways.get(i)<minPrice){
                minPrice=ways.get(i);
            }
        }
        //System.out.println();
        return minPrice;
    }
